{% extends "layouts/baseview.html" %}
{% load i18n %}
{% load short_uri %}

{%block title%}{{project.name}} - {{path}}{%endblock%}

{% block extrascript %}
<script type="text/javascript">
function watch_project(o) {
q_get('prj/watch/{{project.name}}', {}, function(r){
$(o).text(r[0]);
$('#watch_text').text(r[1]);
});

}

function show_diff(prj_path, path, n,m) {
    window.location.href=prj_path+'diff/'+n+':'+m+path;
}
</script>
{% endblock %}


{%block ready_js%}
 $('.btn-diff').click(function() {
   var select_versions=$("#select_versions").val().split(",");   
   var n =select_versions[0];
   var m = select_versions[1];
   if (m == "" || n == "" || n == m) {
       return;
   }
   show_diff('{{project|url}}', '{{path}}', n, m);
    });    
{%endblock%}



{% block stylesheet %}
	<link rel="stylesheet" href="/css/code-min.css" />
{% endblock %}





{%block main-block%}

<div class="d-p-project-content">
            <div class="d-p-project-svn">
                <span class="d-p-project-svnurl">
                    <input type="text" readonly spellcheck="false"  value={{REPOS}}>
                </span>
                <span class="d-p-project-power">
                {% if power == 'all' %}
                
                <b> {% trans "all"%}</b>
                
                {% else %}
                
               	<b> {% trans "want more"%}</b>
                
                {% endif %}
                
                {% if project.owner != user%}
                
                	{% if project.my_status == 3 or project.my_status == 0 %}
                	
					<a class= "d-p-project-praise p-p-project-btn" href= "javascript:void(0);" onclick="watch_project(this);"> 
					{{rs}}
					</a>	
					{% endif %}
					
				{%endif%}
                
                <!-- <a href="javascript:void(0);" class="d-p-project-join p-p-project-btn">{% trans "want join"%}</a> -->
                </span>          
			 </div> 	
			 <h2 class="d-p-project-root">{{project.name}}/



	  {%for p in paths%}
	  
			  <a href="{{project|url}}src/{{p.url}}/">{{p.path}}</a>
			  <span>/</span>
	  {%endfor%}    
</h2>
<a href="javascript:void(0);" class="all-versions btn-diff">{%trans "View changes"%}</a>

        <table class="d-p-project-files">
            <tr>
                <th width="213" class="d-p-project-colfirst">{%trans "Revision"%}</th>
                <th width="370">{%trans "Message"%}</th>
                <th width="190">{%trans "author"%}</th>
                <th>{%trans "Date"%}</th>
            </tr>
            {%for log in logs%}
			<tr id={{log.rev}}>
				<td class="d-p-project-colfirst"><a href="{{project|url}}log/{{log.rev}}{{path}}">r{{log.rev}}</a></td>
				<td>{{log.msg|truncatechars:90|linebreaks}}</td>
				<td><a class="username" href="/u/{{log.author}}/">{{log.author}}</a></td>
				<td>{{log.date|utc2loc}}</td>
			</tr>
            {%endfor%}
            <input type="hidden" id="select_versions" value="">
            
            
		</table>







</div>


<script>
	KISSY.use('js/app/project/project_manage');
</script>
{%endblock%}




